<div class="pa">
  <h2>确认订单</h2>
  <hr/>
  <div class="clearfix">
    <h3>送餐地址</h3>
    <ul>
      <li>姓名：<%= @user.name %></li>
      <li>性别：<%= @user.gender %></li>
      <li>电话：<%= @user.phone %></li>
      <li>地址：<%= @user.address %></li>
    </ul>
    <h3>清单</h3>
    <table>
      <tr>
        <th>名称</th>
        <th>数量</th>
        <th>金额</th>
      </tr>
      <% @carts.each do |cart| %>
        <tr>
          <td><%= cart.product.name %></td>
          <td><%= cart.number %> 份</td>
          <td><%= cart.product.price %>元 × <%= cart.product.discount/10 %> × <%= cart.number %> = <%= cart.number*cart.product.price*cart.product.discount/10 %> 元</td>
        </tr>
      <% end %>
    </table>
    <hr/>
    <div>
      <% if !@user.vouchers.blank? %>
        <div class="pa-bottom clearfix">
          <div class="span-2">代金券：</div>
          <ul class="vouchers span-18">
            <% @user.vouchers.each do |voucher| %>
              <li>
                <%= radio_button_tag 'voucher', voucher.money %>
                <%= label_tag voucher.money %>元代金券
              </li>
            <% end %>
          </ul>
          <div class="span-2">
            <%= link_to '取消使用', '#', :id => 'novouchers' %>
          </div>
        </div>
        <hr/>
      <% end %>
    </div>
    <div class="pa-bottom center red f14">
      总金额：<span id="amount"><%= amount @carts %></span> 元
      <% if !@user.vouchers.blank? %>
        <span id="voucher_money"></span>
      <% end %>
    </div>
    <hr/>
    <div class="text-right">
      <span><%= link_to '提交订单', '/deals/create', :class => 'tdn pa-3 f-border shadow2 radius5', :id => 'makedeal' %></span>
    </div>
  </div>
</div>